<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>TODO</title>
    <style>
        .done{
            text-decoration: line-through;
            color:#999;
        }
    </style>
</head>
<body>
    <form action="/add" method="POST">
        <input type="text" name="title">
        <input type="submit" value="添加">
    </form>
    <p>代办列表</p>
    <hr />
    <ul>
        {% for item in todoList %}
            {% if item.done %}
            <li class="done">
                <input type="checkbox" checked onclick="change({{item.id}})">
                {{ item.mes }}
                <a href="/remove/{{item.id}}">删除</a>
            </li>
            {% else %}
            <li>
                <input type="checkbox" name="" id="" onclick="change({{item.id}})">
                {{ item.mes }}
                <a href="/remove/{{item.id}}">删除</a>
            </li>
            {% endif %}
        {% endfor %}
    </ul>
</body>
<script>
    function change(id){
        window.location.href = '/change/'+id
    }
</script>
</html>